package com.kyubi.common.model;

import java.util.HashMap;
import java.util.Map;
import java.util.Vector;

import com.kyubi.tagger.taggers.StanfordTreeTagger;

public class ChannelModel implements IModel{
	public ChannelModel(){
		
	}
	public ChannelModel(Map<String, Double> wordFreq, Map<String, Double> ruleFreq, StanfordTreeTagger treeTagger){
		m_ChannelProb = new HashMap<String, Double>();
		m_TreeTagger = treeTagger;
		m_WordFreq = wordFreq;
		m_RuleFreq = ruleFreq;
	}
	public void read(Vector<String> data){

		m_Lattice = new Lattice(m_ChannelProb, m_TreeTagger);
		//m_Lattice.buildLattice("I want to start off saying that this camera is small for a reason.", m_WordFreq, m_RuleFreq);
		//m_Lattice.buildLattice("this is an excellent beginners camera", m_WordFreq, m_RuleFreq);
		//m_Lattice.buildLattice("The iPod's sound quality is pretty good.", m_WordFreq, m_RuleFreq);
		m_Lattice.doForward();
		m_Lattice.doBackward();
	}
	public Map<String, Double> getModelCounts(){
		return m_ChannelProb;
	}
	
	private Map<String, Double> m_WordFreq;
	private Map<String, Double> m_RuleFreq;
	private Map<String, Double> m_ChannelProb;
	private StanfordTreeTagger m_TreeTagger;
	private Lattice m_Lattice;
}
